package com.stylefeng.guns.modular.system.dao;

import com.stylefeng.guns.modular.system.model.CashExpenditure;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.stylefeng.guns.modular.system.model.OperationLog;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author stylefeng123
 * @since 2018-07-03
 */
public interface CashExpenditureMapper extends BaseMapper<CashExpenditure> {


    /**
     * 按条件检索现金支出
     * @param platform
     * @param type
     * @param moneyType
     * @return
     */
    List<CashExpenditure> search(@Param("platform")String platform, @Param("type")Integer type,
                                          @Param("moneyType")Integer moneyType,  @Param("beginDate") String beginDate, @Param("endDate") String endDate);

    /**
     * 描述:查询上期余额
     * 创建人: laoyu
     * 日期: 2018/8/9 0009
     * 时间: 下午 2:00
     */
    CashExpenditure searchLast(@Param("platform") String platform);

    /**
     * 按条件检索收支分类总额
     * @param platform
     * @param moneyType
     * @param detailsId
     * @param type
     * @param beginDate
     * @param endDate
     * @return
     */

    CashExpenditure statisticalCash(@Param("platform")String platform, @Param("moneyType")Integer moneyType,@Param("detailsId")Integer detailsId,
                                    @Param("type")Integer type, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    /**
     * 描述:修改当前期和当前期之后的余额
     * 创建人: laoyu
     * 日期: 2018/7/31 0031
     * 时间: 下午 1:57
     */
    void updateBalance(@Param("id") int id,@Param("platform")String platform,@Param("difference")double difference);
}
